]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tweener: follow org.gnome.desktop.interface enable-animations
authorCosimo Cecchi <cosimoc@gnome.org>
Sat, 26 Jan 2013 08:41:46 +0000 (03:41 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 15 Feb 2013 01:42:53 +0000 (20:42 -0500)
Disable the animations by making the animation time a very small value.

https://bugzilla.gnome.org/show_bug.cgi?id=655746

js/ui/tweener.js

index ecfdb2008d16c12795bb400f9048e33d6b9c403b..65de2d8977648f2aeadc01e0d206fac0af15ce79 100644 (file)
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
@@ -44,9 +45,12 @@ const Tweener = imports.tweener.tweener;
 // calls any of these is almost certainly wrong anyway, because they
 // affect the entire application.)
 
+let animationSettings = null;
+
 // Called from Main.start
 function init() {
     Tweener.setFrameTicker(new ClutterFrameTicker());
+    animationSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
 }
 
 
@@ -73,6 +77,9 @@ function _wrapTweening(target, tweeningParameters) {
         }
     }
 
+    if (!animationSettings.get_boolean('enable-animations'))
+        tweeningParameters['time'] = 0.000001;
+
     _addHandler(target, tweeningParameters, 'onStart', _tweenStarted);
     _addHandler(target, tweeningParameters, 'onComplete', _tweenCompleted);
 }